const { DataTypes } = require('sequelize')
const sequelize = require('../config/database')

const AdminModel = sequelize.define('Admin', {
  id: {
    type: DataTypes.INTEGER,
    autoIncrement: true,
    allowNull: false,
    primaryKey: true
  },
  username: {
    type: DataTypes.STRING,
    allowNull: false,
    unique: true
  },
  password: {
    type: DataTypes.STRING,
    allowNull: false,
    unique: true
  },
  email: {
    type: DataTypes.STRING,
    unique: true
  },
  phone: {
    type: DataTypes.STRING,
    unique: true
  },
  avatar: {
    type:DataTypes.JSON
  }
}, {
  freezeTableName: true,
  tableName: 'admin',
  timestamps: false
})

module.exports = AdminModel
